PROGRAM:        Maths Pack
VERSION:        1.4
AUTHOR:         James Vernon - TCPA
DESCRIPTION:    Compilation of maths functions
MACHINES:       TI-83, TI-83+
PLATFORMS:      Ion
LANGUAGE:       Z80 Assembly
RELEASED:       June 2002
SIZE:           TI-83 Size:     5630 bytes
                TI-83+ Size:    5611 bytes



##################
## Introduction ##
##################

    Welcome to Maths Pack, my first (and probably only) maths program in
    assembly for TI-calculators. This program is simply a small compilation
    of useful maths functions that either I have programmed or have been
    sent. It is also made so that it's easy for other people to write and add
    their own functions to it (as long as they know ASM for the TI-83/TI-83+
    calculators).


##################
## Installation ##
##################

    You must have Ion installed on your calculator, preferably the latest
    version (available at http://joewing.calc.org). The latest version of Ion
    at time of release was v1.6.

    TI-83
        Copy the file mathpack.83p to your calculator.

    TI-83+
        Copy the file mathpack.8xp to your calculator.

    Run Ion and select Maths Pack from the menu.


###############
## Main Menu ##
###############

    When you run Maths Pack, you will come to the Main Menu. Here you can
    browse through all the available functions and choose the one you want to
    use. Use the right and left arrow keys to browse through the functions
    and press [2nd] to run one of them. When you are finished in the
    function, you will return to the Main Menu.

    To exit the program, simply press [MODE] at the Main Menu.


#################################
## Function 1: Surd Simplifier ##
#################################

    Author:     James Vernon <james@calc.org>

    This function is for simplifying surds. You will be prompted to enter the
    value of the surd. Do so with the number keys and press [ENTER] when
    you're finished. Use [DEL] to backspace.

    The surd will then be shown in it's most simple form. Press any key to
    return to the Main Menu.

    IMPORTANT: The Surd Simplifier can't yet fully simplify numbers above
    around 1000!


###########################################
## Function 2: Quadratic Equation Solver ##
###########################################

    Author:     James Vernon <james@calc.org>

    This function takes an equation of the form AX^2+BX+C and solves for X.
    You will be promted to enter the values for A, B and C then the program
    will show you the value(s) of X.


#########################################
## Function 3: Vector Magnitude Finder ##
#########################################

    Author:     James Vernon <james@calc.org>

    This function takes a Vector in I, J, K form and calculates is magitude
    for you. Simply enter the I, J & K values and the magnitude will be
    displayed.


#########################################
## Function 4: Angle Between 2 Vectors ##
#########################################

    Author:     James Vernon <james@calc.org>

    This function takes two Vectors in I, J, K form and calculates the angle
    between them. Enter the I, J & K values for Vectors a & b and the angle
    between them will be calculated and displayed.


###################################
## Function 5: Coordinate Master ##
###################################

    Author:     Andrey Gorlin <ag_silver_83p@ameritech.net>

    This function takes two points in (X, Y) format and calculates the
    distance between them, the midpoint of the line, the gradient and the
    X & Y intercepts of the continuous line formed by the two points.


#####################################
## Function 6: Polygon Area Finder ##
#####################################

    Author:     Andrey Gorlin <ag_silver_83p@ameritech.net>

    This function calculates the area of an equilateral polygon given the
    number of sides it has and the length of the sides.


################################
## Function 7: Polygon Helper ##
################################

    Author:     Andrey Gorlin <ag_silver_83p@ameritech.net>

    This function can be used in 3 different ways. Firstly, you can enter the
    number of sides a polygon has to find the number of diagonals it has and
    the sum of the angles. Secondly, you can enter the number of diagonals it
    has to find the number of sides and the sum of the angles. Thirdly, you
    can enter the sum of the angles to find the number of sides and the
    number of diagonals it has.


######################################
## Function 8: Triangle Area Finder ##
######################################

    Author:     Andrey Gorlin <ag_silver_83p@ameritech.net>

    This function finds the area of a triangle by one of 4 methods. Choose
    what variables you wish to enter, enter them and the area will be
    calculated for you.


#######################################
## Function 9: Common Tangent Solver ##
#######################################

    Author:     Andrey Gorlin <ag_silver_83p@ameritech.net>

    This function solves common tangents. Enter the distance and 2 radii and
    the internal and external solutions will be shown.


#########################################
## Function 10: Point to Line Distance ##
#########################################

    Author:     Andrey Gorlin (ag_silver_83p@ameritech.net>

    Calculates the distance between a point and a line given the location of
    the point and the equation of the line.


######################
## Adding Functions ##
######################

    One nice feature of Maths Pack is that with basic knowledge of Z80
    Assembly and the Floating Point Math routines on the TI-83/TI-83+
    calculators, it's simple to create your own functions. Here you will find
    the basic steps of doing so.

    Only a couple of things need to be changed/added in the main source file,
    "mathpack.asm". Near the top in the section marked Constants, is the
    value called "NUM_FUNCTIONS". This is the total number of functions
    currently contained in Maths Pack. Add 1 to this value, then proceed to
    the end of the source file. The last two sections contain firstly the
    name of the files that contain the functions, then 2 pointers for each
    function. In the "Function files" section, add the following line:

    #include "myfile.asm" 

    where "myfile" is the name of the file you will write the function in.
    Finally, in the "Pointers" section, add the following line:

    .dw namePtr,functionPtr 

    where "namePtr" is the label where a description of the function can be
    found and "functionPtr" is the label at the beginning of the actual
    function. If what I have said so far confuses you, take a look at
    "mathpack.asm" and also the beginning of "surd.asm" to see how they go
    together.

    After that you write the actual code for the function. A number of useful
    routines have been included for you to use in any functions you write, if
    you look in the file "routines.asm" you will find these routines and a
    brief description of what they do and how to use them.

    You'll notice in the file "routines.asm" that there are a number of
    routines dealing with "pushing" and "popping" op vars. The functions
    "pushOpx" save a copy of the specified op variable. Note that each time
    you call one of these routines is overwrites the last saved copy of the
    op var. To get the last saved op value, use the required "popOpx" routine.

    There are also two routines "pushOp" and "popOp" which copy the contents
    of a specified op var to a specified location. There are 10 spare buffers
    you can use for this, labelled "float1" - "float10". These are used in a
    few of the functions contained in the package so have a look to see how
    it works if you understand.

    If you have any questions about writing your own functions or you've
    written one that you'd like me to include in a public release of Maths
    Pack, email me and I'll get back to you :)


#####################
## Version History ##
#####################

    v1.0 <> April 2001
        TI-83 Size:  2194 bytes
        TI-83+ Size: 2199 bytes
                - First release
                - 4 functions

    v1.1 <> July 2001
        TI-83 Size:  2221 bytes
        TI-83+ Size: 2226 bytes
                - Added complex answer checking to Quadratic Solver
                - Fixed TI-83+ version to display numbers properly

    v1.2 <> August 2001
        TI-83 Size:  5779 bytes
        TI-83+ Size: 5790 bytes
                - Improved error checking in Surd Simplifier
                - Improved error checking in Quadratic Solver
                - Improved error checking in Vector Angle Finder
                - Added Coordinate Master
                - Added Polygon Area Finder
                - Added Polygon Helper
                - Added Triangle Area Finder
                - Added Common Tangent Solver
                - Fixed a bug on the TI-83+ Ion version when used with
                  MirageOS

    v1.3 <> January 2002
        TI-83 Size:  5635 bytes
        TI-83+ Size: 5616 bytes
                - All of Andrey's functions optimised by Andrey
                - Added Point to Line Distance

    v1.4 <> May 2002
        TI-83 Size:  5630 bytes
        TI-83+ Size: 5611 bytes
                - Triangle Area Finder optimised more by Andrey


##################
## Thanks to... ##
##################

    - Everyone at the TCPA for their help and encouragement.
    - Everyone at the #tcpa channel on IRC for some ideas for functions.
    - Joe Wingbermuehle for Ion.
    - Detached Solutions for MirageOS.
    - Abhishek Doshi for reporting the bugs in v1.0.
    - Andrey Gorlin for reporting the bugs in v1.1 and for writing functions
      5, 6, 7, 8, 9 & 10.



Maths Pack v1.4
Copyright (c)2001-2002 TI-Calculator Programming Alliance
Written and Programmed by James Vernon <james@calc.org>
ICQ#: 71589304
http://www.calc.org/~jamesv
